﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Silverlight.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PlottingBasics.Axis;
using System.Linq;
using PlottingBasics.Functions;

namespace t_PlottingBasics
{
    [TestClass]
    public class t_ApplyFunction
    {
        [TestMethod]
        public void TestCTor()
        {
            LinearAxis ax = new LinearAxis(10, 0.0, 10.0);
            var values = ApplyFunction.Apply(ax, a => a);
        }

        [TestMethod]
        public void TestValues()
        {
            LinearAxis ax = new LinearAxis(10, 0.0, 10.0);
            var values = ApplyFunction.Apply(ax, a => a);
            var all = values.ToArray();

            Assert.AreEqual(11, all.Count(), "count is not right");
            Assert.AreEqual(0, (from p in all where p.X != p.Y select p).Count(), "expected them to all be the same");
        }
    }
}